<%@page import="entities.SiteConfig"%>
<%@page import="entities.Domain"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.lang.reflect.Field"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.TreeMap"%>
<%
	TreeMap check = (TreeMap) request.getAttribute("check");
	Domain domain = (Domain) request.getAttribute("domain");
	SiteConfig siteConfig = (SiteConfig) request.getAttribute("config");
	String image = UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
	String type = (String) request.getAttribute("type");
%>
<jsp:include page="/demo/layouts/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>

		<div class="dir">
			<a href="/home">Home</a> >  Get info domain <%=domain.getDomain() %>
		</div>
		<br />
		<% if (type != null && type.equalsIgnoreCase("verify")) { %>
		<div class="next-verify" style="text-align: right; width: 710px; margin: auto; padding-bottom: 20px;"><a href="/profile/verify?domain=<%=domain.getDomain() %>" > Next >></a></div>
		<% } else { %>
		<div class="next-verify" style="text-align: right; width: 710px; margin: auto; padding-bottom: 20px;"><a href="/info/<%=domain.getDomain() %>" > View site info</a></div>
		<% } %>
		<div class="submit-form">
			<table width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<td colspan="2"><div class="title-form" style="margin-bottom: 20px;">Get domain <%=domain.getDomain() %></div></td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td colspan="2">
							<!--  -->
							<ul>
								<li>
									<span class="txt-msg">Get info server</span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null && check.get("server") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %>
									</span> 
								</li>
								<li>
									<span class="txt-msg">Get site info (title, keywords, description) </span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null && check.get("siteinfo") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %>
									</span>
								</li>
								<li>
									<span class="txt-msg">Get google analytic </span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %>
									</span>
								</li>
								<li>
									<span class="txt-msg">Get google adsence </span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %>
									</span>
								</li>
								<li>
									<span class="txt-msg">Get javascript library </span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Inlink Site </span>
									<span class="ico-msg">
									<% if (check.get("fDomain") == null && check.get("inlink") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get whois </span>
									<span class="ico-msg">
									<% if (check.get("fWhois") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get ip address </span>
									<span class="ico-msg">
									<% if (check.get("fIpAddress") == null && check.get("ipAddress") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get alexa rank, daily visit, country visit </span>
									<span class="ico-msg">
									<% if (check.get("fAlexa") == null && (check.get("alexaRank") == null || check.get("dailyVisitor") == null || check.get("countryVisitor") == null)) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get google Page Rank </span>
									<span class="ico-msg">
									<% if (check.get("googlePageRank") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get age Domain </span>
									<span class="ico-msg">
									<% if (check.get("age") == null || check.get("fAgeDomain") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get HTML validator </span>
									<span class="ico-msg">
									<% if (check.get("fValidator") == null || check.get("validator") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
								<li>
									<span class="txt-msg">Get site same google analytic and google adsence </span>
									<span class="ico-msg">
									<% if (check.get("fGoogleService") == null || check.get("googleService") == null) { %>
										<img src="/demo/images/valid.png"/>
									<% } else { %>
										<img src="/demo/images/error.png"/>
									<% } %> 
									</span>
								</li>
							</ul>
							------------------------------------------------------------- 
							<br />
							<%
							try {
								for (Field f : domain.getClass().getDeclaredFields()) {
									f.setAccessible(true);
									%>
									<b style="color: red;"><%=f.getName() %></b>: <%=f.get(domain) %> <br />
									
									<%
								}
							} catch (Exception e) {
								e.printStackTrace();
							}
							%>
							<br />
							-------------------------------------------------------------
							<br />
							<%
							//Get a set of the entries 
							Set set = check.entrySet(); 
							// Get an iterator 
							Iterator i = set.iterator(); 
							// Display elements 
							while(i.hasNext()) { 
								Map.Entry me = (Map.Entry)i.next(); 
								%>
								<div style="color: red"><%=me.getKey() %>: <%=me.getValue() %></div>
							<% 
							} 
							%>
							<!--  -->
						</td>
					</tr>
				</tbody>
			</table>
		</div>

<jsp:include page="/demo/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>